package com.yibo.manager.user.controller;

import com.yibo.manager.user.ManagerUserService;
import com.yibo.manager.user.pojo.ManagerUserMsg;
import com.yibo.support.encry.MD5Helper;
import com.yibo.support.helper.ResultHelper;
import com.yibo.support.pojo.IResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.yibo.support.constant.ApiUrlConstant.PUBLIC_URL;

@RestController
@RequestMapping(PUBLIC_URL+"/managerUser")
public class ManagerUserPublicController {

    @Resource
    private ManagerUserService managerUserService;

    @PostMapping("/login")
    public IResult<ManagerUserMsg> login(@RequestParam(value = "userId")String userId,
                                         @RequestParam(value = "password")String password){
        return ResultHelper.result("登陆成功",managerUserService.login(userId,password));
    }


}
